/****** Object:  Table [dbo].[sql_table_constraints]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[sql_table_constraints](
	[dbms_type_name] [varchar](150) NOT NULL,
	[dbms_name] [varchar](150) NOT NULL,
	[database_name] [varchar](150) NOT NULL,
	[constraint_schema] [varchar](150) NOT NULL,
	[constraint_name] [varchar](150) NOT NULL,
	[table_catalog] [varchar](150) NOT NULL,
	[table_schema] [varchar](150) NOT NULL,
	[table_name] [varchar](150) NOT NULL,
	[constraint_type] [varchar](150) NOT NULL,
	[is_deferrable] [varchar](14) NOT NULL,
	[initially_deferred] [varchar](14) NOT NULL,
 CONSTRAINT [PK_sql_table_constraints] PRIMARY KEY CLUSTERED 
(
	[dbms_type_name] ASC,
	[dbms_name] ASC,
	[database_name] ASC,
	[constraint_schema] ASC,
	[constraint_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[sql_referential_constraints]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[sql_referential_constraints](
	[dbms_type_name] [varchar](150) NOT NULL,
	[dbms_name] [varchar](150) NOT NULL,
	[database_name] [varchar](150) NOT NULL,
	[constraint_schema] [varchar](150) NOT NULL,
	[constraint_name] [varchar](150) NOT NULL,
	[unique_constraint_catalog] [varchar](150) NULL,
	[unique_constraint_schema] [varchar](150) NULL,
	[unique_constraint_name] [varchar](150) NULL,
	[match_option] [varchar](150) NULL,
	[update_rule] [varchar](150) NULL,
	[delete_rule] [varchar](150) NULL,
 CONSTRAINT [PK_sql_referential_constraints] PRIMARY KEY CLUSTERED 
(
	[dbms_type_name] ASC,
	[dbms_name] ASC,
	[database_name] ASC,
	[constraint_schema] ASC,
	[constraint_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[sql_key_column_usage]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[sql_key_column_usage](
	[dbms_type_name] [varchar](150) NOT NULL,
	[dbms_name] [varchar](150) NOT NULL,
	[constraint_catalog] [varchar](150) NULL,
	[constraint_schema] [varchar](150) NULL,
	[constraint_name] [varchar](150) NOT NULL,
	[table_catalog] [varchar](150) NULL,
	[table_schema] [varchar](150) NULL,
	[table_name] [varchar](150) NOT NULL,
	[column_name] [varchar](150) NULL,
	[ordinal_position] [int] NOT NULL,
	[load_dtm] [datetime] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[sql_columns]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[sql_columns](
	[dbms_type_name] [varchar](150) NOT NULL,
	[dbms_name] [varchar](150) NOT NULL,
	[database_name] [varchar](150) NOT NULL,
	[table_schema] [varchar](150) NOT NULL,
	[table_name] [varchar](150) NOT NULL,
	[column_name] [varchar](150) NOT NULL,
	[ordinal_position] [int] NULL,
	[column_default] [varchar](550) NULL,
	[is_identity] [char](5) NULL,
	[is_nullable] [char](5) NULL,
	[data_type] [varchar](150) NULL,
	[character_maximum_length] [int] NULL,
	[character_octet_length] [int] NULL,
	[numeric_precision] [int] NULL,
	[numeric_precision_radix] [int] NULL,
	[numeric_scale] [int] NULL,
	[datetime_precision] [int] NULL,
	[character_set_catalog] [varchar](150) NULL,
	[character_set_schema] [varchar](150) NULL,
	[character_set_name] [varchar](150) NULL,
	[collation_catalog] [varchar](150) NULL,
	[collation_schema] [varchar](150) NULL,
	[collation_name] [varchar](150) NULL,
	[domain_catalog] [varchar](150) NULL,
	[domain_schema] [varchar](150) NULL,
	[domain_name] [varchar](150) NULL,
	[load_dtm] [datetime] NOT NULL,
 CONSTRAINT [PK_sql_columns] PRIMARY KEY CLUSTERED 
(
	[dbms_type_name] ASC,
	[dbms_name] ASC,
	[database_name] ASC,
	[table_schema] ASC,
	[table_name] ASC,
	[column_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IE1sql_columns_dbms_name_IDX] ON [dbo].[sql_columns] 
(
	[dbms_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[exclusion_lku]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[exclusion_lku](
	[dbms_type_name] [varchar](10) NOT NULL,
	[dbms_name] [varchar](250) NOT NULL,
	[database_name] [varchar](250) NOT NULL,
 CONSTRAINT [PK_exclusion_lku] PRIMARY KEY CLUSTERED 
(
	[dbms_type_name] ASC,
	[dbms_name] ASC,
	[database_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[exclusion_lku] ([dbms_type_name], [dbms_name], [database_name]) VALUES (N'sqlserver', N'ALL', N'master')
INSERT [dbo].[exclusion_lku] ([dbms_type_name], [dbms_name], [database_name]) VALUES (N'sqlserver', N'ALL', N'model')
INSERT [dbo].[exclusion_lku] ([dbms_type_name], [dbms_name], [database_name]) VALUES (N'sqlserver', N'ALL', N'msdb')
INSERT [dbo].[exclusion_lku] ([dbms_type_name], [dbms_name], [database_name]) VALUES (N'sqlserver', N'ALL', N'tempdb')
/****** Object:  Table [dbo].[error_log]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[error_log](
	[error_log_id] [int] IDENTITY(1,1) NOT NULL,
	[source] [varchar](100) NOT NULL,
	[message] [varchar](max) NOT NULL,
	[log_dtm] [datetime] NOT NULL,
 CONSTRAINT [PK_error_log] PRIMARY KEY CLUSTERED 
(
	[error_log_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[dbms_lku]    Script Date: 08/24/2010 20:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[dbms_lku](
	[dbms_name] [varchar](255) NOT NULL,
	[dbms_type] [varchar](25) NOT NULL,
	[connection_string] [varchar](2000) NOT NULL,
	[is_encrypted] [bit] NOT NULL,
	[is_enabled] [bit] NOT NULL,
	[has_databases] [bit] NOT NULL,
 CONSTRAINT [PK_dbms_lku] PRIMARY KEY CLUSTERED 
(
	[dbms_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Default [CURRENT_DATE46]    Script Date: 08/24/2010 20:52:40 ******/
ALTER TABLE [dbo].[error_log] ADD  CONSTRAINT [CURRENT_DATE46]  DEFAULT (getdate()) FOR [log_dtm]
GO
/****** Object:  Default [DF_dbms_lku_is_encrypted]    Script Date: 08/24/2010 20:52:40 ******/
ALTER TABLE [dbo].[dbms_lku] ADD  CONSTRAINT [DF_dbms_lku_is_encrypted]  DEFAULT ((0)) FOR [is_encrypted]
GO
/****** Object:  Default [DF_dbms_lku_is_enabled]    Script Date: 08/24/2010 20:52:40 ******/
ALTER TABLE [dbo].[dbms_lku] ADD  CONSTRAINT [DF_dbms_lku_is_enabled]  DEFAULT ((1)) FOR [is_enabled]
GO
/****** Object:  Default [DF_has_databases]    Script Date: 08/24/2010 20:52:40 ******/
ALTER TABLE [dbo].[dbms_lku] ADD  CONSTRAINT [DF_has_databases]  DEFAULT ((0)) FOR [has_databases]
GO
